<#assign menu="product">
<#include "/manage/head.ftl">
<!--main content start-->
<section id="main-content">
	<section class="wrapper">
		<!-- page start-->
		<form id="add_authorization_form" class="form-horizontal" action="${BASE_PATH}/manage/product/add.json"  autocomplete="off"  method="post"
			enctype="multipart/form-data">
		<div class="row">
			<div class="col-lg-12">
				<section class="panel">
					<header class="panel-heading"> 
						新增产品
					</header>
					<div class="panel-body">
						<div class="form-group" <#if param=='jobs'>style="display: none;"</#if>>
                          <label class="col-sm-2 col-sm-2 control-label">产品名称</label>
                          <div class="col-sm-10">
                              <input type="text" style="font-size:15px;width: 300px;" class="form-control" name="productName"
                              	placeholder="产品名称" id="productName" >
                              </input>
                          </div>
                        </div>
                        <div class="form-group">
                          <label class="col-sm-2 col-sm-2 control-label">上传产品图片</label>
                          <div class="col-sm-10">
                          	<input type="file" name="file" multiple="multiple"
                              	id="file" >
                          </div>
                      	</div>
                      	<div class="form-group">
                          <label class="col-sm-2 col-sm-2 control-label">价格</label>
                          <div class="col-sm-10">
                              <input type="text" style="font-size:15px;width: 300px;" class="form-control" name="price"
                              	placeholder="价格" id="price" >
                              </input>
                          </div>
                        </div>
						<div class="form-group">
                              <label class="col-sm-2 col-sm-2 control-label">产品详情</label>
                              <div class="col-sm-10">
                                  <script id="content" name="content" type="text/plain"
										style="width: 100%; height: 260px;"></script>
								  <script type="text/javascript">
									var contentEditor;
									$(function() {
										contentEditor = UE.getEditor('content');
									});
								  </script>
                              </div>
                        </div> 
                        <div class="form-group">
                      	  <div class="col-lg-offset-2 col-lg-10">
                          <button class="btn btn-shadow btn-primary" type="submit">新增</button>
                          </div>
                      </div>
					</div>
				</section>
				
			</div>
		</div>
		</form>
		<!-- page end-->
	</section>
</section>
<!--main content end-->
<script type="text/javascript">
$(function(){
	$('#add_authorization_form').ajaxForm({
		dataType : 'json',
		success : function(data) {
			if (data.result) {
				bootbox.alert("保存成功，将刷新页面", function() {
					window.location.reload();
					
				});
			}else{
				showErrors($('#add_authorization_form'),data.errors);
			}
		}
	});
});
</script>
<#include "/manage/foot.ftl">